﻿using System;
using System.Collections.Generic;
using System.Text;

namespace 责任链模式
{
    //实现审批类，经理
    class Manager : Approver
    {
        public Manager(string name) : base(name)
        {

        }

        public override void ProcessRequest(PurchaseRequest purchaseRequest)
        {
            if (purchaseRequest.Amount < 10000)
            {
                Console.WriteLine("{0}-{1} 批准了购买申请 {2}",this,Name,purchaseRequest.ProductName);
            }
            else if (NextApprover != null)
            {
                NextApprover.ProcessRequest(purchaseRequest);
            }
        }
    }
}
